package com.xxl.job.executor.service.jobhandler;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import com.xxl.job.executor.process.DhProcess;
import org.springframework.stereotype.Component;

/**
 * 文件描述
 *
 * @author wang.kunlin
 * @date 2020年09月28日 9:49
 */

@JobHandler(value = "DhCollectJobHandler")
@Component
public class DhCollectJobHandler  extends IJobHandler {


    @Override
    public ReturnT<String> execute(String param)throws Exception {
        //判断入参数据合法性
        if (param.length() < 7) {
            XxlJobLogger.log("非法采集口号，程序退出");
            return FAIL;
        }
        XxlJobLogger.log("====Start Collect Job,GatherID:" + param + "====");
        DhProcess dhProcess=new DhProcess(param);
        dhProcess.collectProcessor();

        return FAIL;
    }
}
